{
GtkEntryPrivate *priv;
EntryIconInfo *icon_info;
- cairo_surface_t *surface;
- GdkPixbuf *pixbuf;
- int width, height;
g_return_val_if_fail (GTK_IS_ENTRY (entry), NULL);
g_return_val_if_fail (IS_VALID_ICON_POSITION (icon_pos), NULL);
if (!icon_info)
return NULL;
- _gtk_icon_helper_get_size (GTK_ICON_HELPER (icon_info->gadget), &width, &height);
- surface = gtk_icon_helper_load_surface (GTK_ICON_HELPER (icon_info->gadget), 1);
-
- pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, width, height);
-
- cairo_surface_destroy (surface);
-
- /* HACK: unfortunately this is transfer none, so we attach it somehwere
- * convenient.
- */
- if (pixbuf)
- {
- g_object_set_data_full (G_OBJECT (icon_info->gadget),
- "gtk-entry-pixbuf",
- pixbuf,
- g_object_unref);
- }
-
- return pixbuf;
+ return _gtk_icon_helper_peek_pixbuf (GTK_ICON_HELPER (icon_info->gadget));
}
/**
GtkImageDefinition *gtk_icon_helper_get_definition (GtkIconHelper *self);
const gchar *_gtk_icon_helper_get_icon_name (GtkIconHelper *self);
-cairo_surface_t *gtk_icon_helper_load_surface (GtkIconHelper *self,
- int scale);
void _gtk_icon_helper_get_size (GtkIconHelper *self,
gint *width_out,
gint *height_out);